<template> 
 
 
    <el-form  label-width="120px">  
         <el-form-item> 
             <el-button type="primary" @click="addData">添加数据源</el-button>    
        </el-form-item>
        <el-form-item v-for="(item,index) in this.item.ui.widgetConfig.enumSource" :key="index"> 
            <el-row>
                <el-col>
                    value:<el-input v-model="item.value" style="width:100px"></el-input> 
                    label:<el-input v-model="item.label" style="width:100px"></el-input> 
                     <el-button type="danger" icon="el-icon-close"  @click="handerDelete(index)" circle></el-button>  
                </el-col>
            </el-row>
        </el-form-item>
        <el-form-item  label="是否只读："> 
         <el-radio v-model="item.ui.disabled" :label="true">是</el-radio>
         <el-radio v-model="item.ui.disabled" :label="false">否</el-radio> 
        </el-form-item>
        <el-form-item  label="是否禁用："> 
         <el-radio v-model="item.ui.readonly" :label="true">是</el-radio>
         <el-radio v-model="item.ui.readonly" :label="false">否</el-radio> 
        </el-form-item> 
        <el-form-item  label="是否支持多选："> 
         <el-radio v-model="item.ui.widgetConfig.multiple" :label="true">是</el-radio>
         <el-radio v-model="item.ui.widgetConfig.multiple" :label="false">否</el-radio> 
        </el-form-item>
        <el-form-item  label="是否支持查询："> 
         <el-radio v-model="item.ui.widgetConfig.filterable" :label="true">是</el-radio>
         <el-radio v-model="item.ui.widgetConfig.filterable" :label="false">否</el-radio> 
        </el-form-item>
          <el-form-item label="提示语："> 
            <el-input placeholder="请输入提示语：" v-model="item.ui.widgetConfig.placeholder" style="width:430px"></el-input>  
        </el-form-item> 
        <el-button @click="handerClick">关闭</el-button>
    </el-form>
</template>

<script>
export default {
  props: ["item"],
  name: "selectitem",
  methods: {
    handerClick: function() { 
      this.$emit("hclick");
    },
    addData: function() {
     this.item.ui.widgetConfig.enumSource.push({ value: "", label: "" });
    },
    handerDelete: function(index) {
     this.item.ui.widgetConfig.enumSource.splice(index, 1);
    }
  }
};
</script>

